package com.wmb.userservice.openFeigin;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "permission-service")
public interface UserFeignClient {

    /**
     * 绑定默认角色
     * @param userId
     * @return
     */
    @GetMapping("/permission/default/role")
    Integer bindDefaultRole(@RequestParam Long userId);

    /**
     * 获取用户角色权限
     * @param userId
     * @return
     */
    @GetMapping("/permission/get/roleId")
    Integer getRoleId(@RequestParam Long userId);

    /**
     * 鉴权
     * @param loginUserId
     * @param checkoutId
     * @return
     */
    @GetMapping("/permission/checkout")
    Boolean permissionCheckout(@RequestParam Long loginUserId, @RequestParam Long checkoutId);

    /**
     * 更新用户角色权限 --  superAdmin专用
     * @param userId
     * @param userNewRoleId
     * @return
     */
    @GetMapping("/permission/alter-permission")
     Integer alterUserPermission(@RequestParam Long userId, @RequestParam String userNewRoleId);
}
